part of 'dto.dart';

WebRtcLoginReq _$WebRtcLoginReqFromJson(Map<String, dynamic> json) => WebRtcLoginReq(
  userId: json['userId'] as String,
  authToken: json['authToken'] as String,
  tenantCode: json['tenantCode'] as String,
  terminalType: json['terminalType'] as String,
)
  ..localSeq = json['localSeq'] as String?
  ..createDateTime = json['createDateTime'] == null ? null : DateTime.parse(json['createDateTime'] as String);


Map<String, dynamic> _$WebRtcLoginReqToJson(WebRtcLoginReq instance) => <String, dynamic>{
  'createDateTime': DateUtil.formatDate(instance.createDateTime),
  'localSeq': instance.localSeq,
  'userId': instance.userId,
  'authToken': instance.authToken,
  'tenantCode': instance.tenantCode,
  'terminalType': instance.terminalType,
};

WebRtcCreateRoomReq _$WebRtcCreateRoomReqFromJson(Map<String, dynamic> json) => WebRtcCreateRoomReq(
  chatType: $enumDecode(_$ChatTypeEnumMap, json['chatType']),
)..roomName = json['roomName'] as String?
  ..userId = json['userId'] as String?
  ..localSeq = json['localSeq'] as String?
  ..createDateTime = json['createDateTime'] == null ? null : DateTime.parse(json['createDateTime'] as String);


Map<String, dynamic> _$WebRtcCreateRoomReqToJson(WebRtcCreateRoomReq instance) => <String, dynamic>{
  'createDateTime': DateUtil.formatDate(instance.createDateTime),
  'localSeq': instance.localSeq,
  'roomName': instance.roomName,
  'userId': instance.userId,
  'chatType': _$ChatTypeEnumMap[instance.chatType],
};


WebRtcJoinRoomReq _$WebRtcJoinRoomReqFromJson(Map<String, dynamic> json) => WebRtcJoinRoomReq(
  roomName: json['roomName'] as String,
)
  ..userId = json['userId'] as String?
  ..localSeq = json['localSeq'] as String?
  ..createDateTime = json['createDateTime'] == null ? null : DateTime.parse(json['createDateTime'] as String);


Map<String, dynamic> _$WebRtcJoinRoomReqToJson(WebRtcJoinRoomReq instance) => <String, dynamic>{
  'createDateTime': DateUtil.formatDate(instance.createDateTime),
  'localSeq': instance.localSeq,
  'roomName': instance.roomName,
  'userId': instance.userId,
};


WebRtcExitRoomReq _$WebRtcExitRoomReqFromJson(Map<String, dynamic> json) => WebRtcExitRoomReq(
  roomName: json['roomName'] as String,
)
  ..userId = json['userId'] as String?
  ..localSeq = json['localSeq'] as String?
  ..createDateTime = json['createDateTime'] == null ? null : DateTime.parse(json['createDateTime'] as String);


Map<String, dynamic> _$WebRtcExitRoomReqToJson(WebRtcExitRoomReq instance) => <String, dynamic>{
  'createDateTime': DateUtil.formatDate(instance.createDateTime),
  'localSeq': instance.localSeq,
  'roomName': instance.roomName,
  'userId': instance.userId,
};

WebRtcP2pCandidateReq _$WebRtcP2pCandidateReqFromJson(Map<String, dynamic> json) => WebRtcP2pCandidateReq(
  iceCandidate: IceCandidate(
      sdpMid: json['iceCandidate']['sdpMid'] as String,
      sdpMLineIndex: json['iceCandidate']['sdpMLineIndex'] as int,
      candidate: json['iceCandidate']['candidate'] as String,
  )..serverUrl = json['iceCandidate']['serverUrl'] as String?,
  toUserId: json['toUserId'] as String,
  roomName: json['roomName'] as String,
)
  ..userId = json['userId'] as String?
  ..localSeq = json['localSeq'] as String?
  ..createDateTime = json['createDateTime'] == null ? null : DateTime.parse(json['createDateTime'] as String);


Map<String, dynamic> _$WebRtcP2pCandidateReqToJson(WebRtcP2pCandidateReq instance) => <String, dynamic>{
  'createDateTime': DateUtil.formatDate(instance.createDateTime),
  'localSeq': instance.localSeq,
  'roomName': instance.roomName,
  'userId': instance.userId,
  'toUserId': instance.toUserId,
  'iceCandidate': {
    'sdpMid': instance.iceCandidate.sdpMid,
    'sdpMLineIndex': instance.iceCandidate.sdpMLineIndex,
    'candidate': instance.iceCandidate.candidate,
    'serverUrl': instance.iceCandidate.serverUrl,
  }
};


WebRtcP2pSdpReq _$WebRtcP2pSdpReqFromJson(Map<String, dynamic> json) => WebRtcP2pSdpReq(
  roomName: json['roomName'] as String,
  toUserId: json['toUserId'] as String,
  sdp: json['sdp'] as String,
  sdpType: SdpType.ofName(json['sdpType']),
)
  ..userId = json['userId'] as String?
  ..localSeq = json['localSeq'] as String?
  ..createDateTime = json['createDateTime'] == null ? null : DateTime.parse(json['createDateTime'] as String);


Map<String, dynamic> _$WebRtcP2pSdpReqToJson(WebRtcP2pSdpReq instance) => <String, dynamic>{
  'createDateTime': DateUtil.formatDate(instance.createDateTime),
  'localSeq': instance.localSeq,
  'roomName': instance.roomName,
  'userId': instance.userId,
  'toUserId': instance.toUserId,
  'sdp': instance.sdp,
  'sdpType': instance.sdpType.name,
};


WebRtcDelRoomReq _$WebRtcDelRoomReqFromJson(Map<String, dynamic> json) => WebRtcDelRoomReq(
  roomName: json['roomName'] as String,
)
  ..userId = json['userId'] as String?
  ..localSeq = json['localSeq'] as String?
  ..createDateTime = json['createDateTime'] == null ? null : DateTime.parse(json['createDateTime'] as String);


Map<String, dynamic> _$WebRtcDelRoomReqToJson(WebRtcDelRoomReq instance) => <String, dynamic>{
  'createDateTime': DateUtil.formatDate(instance.createDateTime),
  'localSeq': instance.localSeq,
  'roomName': instance.roomName,
  'userId': instance.userId,
};

const _$ChatTypeEnumMap = {
  ChatType.audio: 1,
  ChatType.video: 2,
  ChatType.sharing: 3,
};